import request from '@/api/request'

export function productsByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/product/productsByPage/${start}/${limit}`,
    method: "post",
    data
  })
}

export function findAllBrand() {
  return request({
    url: `/lejuAdmin/brand/findAllBrand`,
    method: 'get'
  })
}

export function switchNewStatus(data) {
  return request({
    url: `/lejuAdmin/product/switchNewStatus`,
    method: "post",
    data
  })
}

export function switchPublishStatus(data) {
    return request({
      url: `/lejuAdmin/product/switchPublishStatus`,
      method: "post",
      data
    })
}
  
export function switchRecommandStatus(data) {
    return request({
      url: `/lejuAdmin/product/switchRecommandStatus`,
      method: "post",
      data
    })
}

export function switchVerifyStatus(data) {
    return request({
      url: `/lejuAdmin/product/switchVerifyStatus`,
      method: "post",
      data
    })
}

export function del(productId) {
    return request({
      url: `/lejuAdmin/product/del/${productId}`,
      method: "DELETE"
    })
}

export function getSkusByProductId(productId) {
  return request({
    url: `/lejuAdmin/sku/getSkusByProductId/${productId}`
  })
}

export function addProductSkus(data) {
  return request({
    url: `/lejuAdmin/sku/addProductSkus`,
    method: "post",
    data
  })
}

export function delSku(skuId) {
  return request({
    url: `/lejuAdmin/sku/delSku/${skuId}`,
    method: "DELETE"
  })
}

export function updateSkuInfo(data) {
  return request({
    url: `/lejuAdmin/sku/updateSkuInfo`,
    method: "post",
    data
  })
}






